package com.study8.demo8.globalData;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ModelAttribute;

import java.util.HashMap;
import java.util.Map;

/**
 * @ClassName MyglobalData
 * @Description: TODO
 * @Date: 2022/3/30 13:28
 * @Version 1.0
 */
@ControllerAdvice
public class MyGlobalData {
  @ModelAttribute(value = "info")
  public Map<String,Object> globalData(){
    Map<String,Object> map = new HashMap<>();
    map.put("name","小红");
    map.put("age",18);
    return map;
  }
}
